package cn.xopencode.recordservice.convert.kvoperation;

import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.dal.mysql.dataobject.kvoperation.KvOperationRecordDetailDO;
import cn.xopencode.recordservice.dal.mysql.dataobject.kvoperation.KvOperationRecordOtherDO;
import cn.xopencode.recordservice.rpc.kvoperation.dto.*;
import cn.xopencode.recordservice.rpc.kvoperation.vo.KvOperationRecordNextVO;
import cn.xopencode.recordservice.rpc.kvoperation.vo.KvOperationRecordPageVO;
import cn.xopencode.recordservice.rpc.kvoperation.vo.KvOperationRecordVO;
import cn.xopencode.recordservice.service.kvoperation.bo.KvOperationRecordBO;
import cn.xopencode.recordservice.service.kvoperation.bo.KvOperationRecordNextCreateBO;
import cn.xopencode.recordservice.service.kvoperation.bo.KvOperationRecordOtherPageBO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface KvOperationRecordConvert {

    KvOperationRecordConvert INSTANCE = Mappers.getMapper(KvOperationRecordConvert.class);

    KvOperationRecordOtherPageBO convert(KvOperationRecordPageDTO dto);

    KvOperationRecordBO convert(KvOperationRecordCreateDTO createDTO);

    KvOperationRecordBO convert(KvOperationRecordUpdateDTO createDTO);

    KvOperationRecordNextCreateBO convert(KvOperationRecordNextCreateDTO nextCreateBO);

    KvOperationRecordNextCreateBO convert(KvOperationRecordNextUpdateDTO nextCreateBO);

    KvOperationRecordDetailDO convert(KvOperationRecordNextCreateBO nextCreateBO);

    KvOperationRecordOtherDO convert(KvOperationRecordBO recordBO);

    KvOperationRecordDetailDO convert2(KvOperationRecordBO recordBO);

    KvOperationRecordVO convert(KvOperationRecordOtherDO otherDO);

    @Mapping(source = "id", target = "recordDetailId")
    KvOperationRecordNextVO convert(KvOperationRecordDetailDO detailDO);
    @Mapping(source = "records", target = "list")
    PageResult<KvOperationRecordPageVO> convertPage(IPage<KvOperationRecordOtherDO> otherDOIPage);
}
